import { formKeys, searchKeys } from 'config/mock'
export default function useKeys() {
  const getKeys = (val, type) => {
    if (type == 'search') {
      return searchKeys[val]
    } else {
      return formKeys[val]
    }
  }
  // 获取动态值集视图回显的值
  const getRowKey = (val) => {
    return formKeys[val]
  }
  // 单据模版-动态值集弹框的key
  const getLovViewRowKey = (fieldCode) => {
    let keys = {}
    return keys[fieldCode] || 'id'
  }
  return { getLovViewRowKey, getKeys, getRowKey }
}
